home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
wtj201.zip
/
KIYOOKA.ZIP
/
HEAPTEST.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-10-23
|
4KB
|
102 lines
//Filename: HEAPTEST.C
//"HEAPTEST" Generated by WindowsMAKER Professional
//Author: Gen Kiyooka
//
// Code in this file is initially generated by WindowsMAKER Professional.
// This file contains the WINMAIN and the MAINWINPROC functions.
// You can override the functionality supplied by WindowsMAKER Professional
// by adding your own code or replacing calls in this file. For example if
// you want to change the normal flow of events and bring up a login box
// before the main window is displayed, you would add the code here.
// For more information see the section "How Code is Generated" in the
// documentation.
#include <WINDOWS.H>
#include "HEAPTEST.H"
WMPDEBUG
#include "HEAPTEST.WMC"
//*************************************************************
// WinMain FUNCTION
//*************************************************************
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MSG msg; // message
hInst = hInstance; // Saves the current instance
if (!BLDInitApplication(hInstance,hPrevInstance,&nCmdShow,lpCmdLine))
return FALSE;
if (!hPrevInstance) // Is there an other instance of the task
{
if (!BLDRegisterClass(hInstance))
return FALSE; // Exits if unable to initialize
}
MainhWnd = BLDCreateWindow(hInstance);
if (!MainhWnd) // Check if the window is created
return FALSE;
ShowWindow(MainhWnd, nCmdShow); // Show the window
UpdateWindow(MainhWnd); // Send WM_PAINT message to window
BLDInitMainMenu(MainhWnd); // Initialize main menu if necessary
while (GetMessage(&msg, // message structure
0, // handle of window receiving the message
0, // lowest message to examine
0)) // highest message to examine
{
if (BLDKeyTranslation(&msg)) // WindowsMAKER code for key translation
continue;
TranslateMessage(&msg); // Translates character keys
DispatchMessage(&msg); // Dispatches message to window
}
BLDExitApplication(); // Clean up if necessary
return(msg.wParam); // Returns the value from PostQuitMessage
}
//*************************************************************
// WINDOW PROCEDURE FOR MAIN WINDOW
//*************************************************************
LONG FAR PASCAL BLDMainWndProc(HWND hWnd, UINT message, UINT wParam, LONG lParam )
{
switch (message)
{
case WM_CREATE: // window creation
// Send to BLDDefWindowProc in (.WMC) for controls in main window
return BLDDefWindowProc(hWnd, message, wParam, lParam);
break;
case WM_SETFOCUS: // window is notified of focus change
// Send to BLDDefWindowProc in (.WMC) for controls in main window
return BLDDefWindowProc(hWnd, message, wParam, lParam);
break;
case WM_DESTROY: // window being destroyed
PostQuitMessage(0);
return BLDDefWindowProc(hWnd, message, wParam, lParam);
break;
case WM_COMMAND: // command from the main window
if (BLDMenuCommand(hWnd, message, wParam, lParam))
break; // Processed by BLDMenuCommand.
// else default processing by BLDDefWindowProc.
default:
// Pass on message for default processing
return BLDDefWindowProc(hWnd, message, wParam, lParam);
}
return FALSE; // Returns FALSE if processed
}